﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComplexNumber
{
    class ComplexNumberTest
    {
        static void Main()
        {
            ComplexNumber a = new ComplexNumber(2, 3);
            ComplexNumber b = new ComplexNumber(4, -5);

            ComplexNumber sum = a + b;
            Console.WriteLine("({0}) + ({1}) = {2}", a, b, sum);

            ComplexNumber sub = a - b;
            Console.WriteLine("({0}) - ({1}) = {2}", a, b, sub);

            ComplexNumber product = a * b;
            Console.WriteLine("({0})({1}) = {2}", a, b, product);

            ComplexNumber division = a / b;
            Console.WriteLine("({0}) / ({1}) = {2}", a, b, division);

            double numberToConvert = 5.3;
            ComplexNumber c = (ComplexNumber)numberToConvert;
            Console.WriteLine(c);

            double convertedNumber = (double)c;
            Console.WriteLine(convertedNumber);

            Console.WriteLine("Number: {0}", a);
            Console.WriteLine("Real: {0}", a[0]);
            Console.WriteLine("Imaginary: {0}", a[1]);
        }
    }
}
